<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="s"  uri="/struts-tags"%>

<title>法人基本信息</title><span id="navlink"> 企业客户信息  >> 法人基本信息</span>

<script type="text/javascript"src="<%=request.getContextPath()%>/js/custom/companybasic.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/common/money2chinese.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/common/numdiv.js"></script>   <s:if test='#session.eflage=="show"'> <style type="text/css">	select {border:0;-webkit-appearance: none;} </style> </s:if>  

<style type="text/css">
.ftab ul li{padding:0 10px;float:left;font-weight:bold;}
.ftab a{color:black}
.ftab a:hover{text-decoration:underline;}




</style>



<script>
  $(function() {
    $( "#accordion" ).accordion({
      collapsible: true
    });
  });
 </script>

<div id="accordion" style="width:auto">
  <h3>客户信息登记</h3>
  <div class="ftab">
    <ul >
			<li><a href="customShow!companyread">基本信息</a></li>
			<li><a href="customList!contactlist">联系信息</a></li>
			<li><a href="customList!topmanagerlist">高管信息</a></li>
			<li><a href="customList!prosecutedlist">被起诉信息</a></li>
			<li><a href="customList!investorlist">投资人信息</a></li>
			<li><a href="customList!foreigninvestorlist">对外投资信息</a></li>
			<!-- 
			<li><a href="customList!guarantorlist">法人保证人专用信息表</a></li>
			 -->
			<li><a href="customList!pledgercompanylist">抵质押清单信息</a></li>			
		
			<li><a href="customList!managelist">管理信息</a></li>	
					
			<li><a href="customList!externalguaranteelist">对外担保信息</a></li>
			<!-- 
			<li><a href="NewCompanyOtherrelation">法人其他关联关系表</a></li>
			 -->
			 
			<li><a href="customList!otherloanlist">其他借款</a></li>
			 
			<li><a href="customList!bankcreditlist">银行信贷信息</a></li>
			
			
			
			<li><a href="customList!cashflowlist">现金流量表</a></li>
			<li><a href="customList!assetsdebtlist">资产负债表</a></li>
			<li><a href="customList!profitlist">损益表表</a></li>	
			 <li><a href="upload!filelist?listtype=1">客户基础资料归档目录</a></li>
			 <li><a href="upload!filelist?listtype=2">客户必备资料归档目录</a></li>			
				<!-- <li><a href="./ListCompanyPledger!getCompanyPledgerList">抵押清单信息</a></li> -->			
		</ul>
  </div>
</div>
<div class="clear"></div>

<div id="msg"></div>

<s:if test='FLAG=="EDIT"'>
	<form name="newCompanyBasic" action="customActionDo!companyupdate" method="post" id="form">
</s:if>
<s:else>
	<form name="newCompanyBasic" action="customActionDo!companysave" method="post" id="form">
</s:else>

<input type="hidden" id="eflage" name="eflage" value="${sessionScope.eflage }" />
<table class="table_box table_all_border" cellspacing="0" cellpadding="0">
<tr>
<td align="right">客户id</td> 
<td>
RF02<input type="text" class="companyid"  readonly="readonly" name="cbasic.id"  id="companyid"  value="${sessionScope.companyid}" /></td>
<th><span class="need"> </span>组织机构代码 </th>
<td><input type="text" name="cbasic.organizationcode" id="companycode" value="${cbasic.organizationcode }" /></td>
</tr>
<tr>
<th><span class="need"> </span>中文全称</th>
<td colspan="3" class="wet" ><input type="text" class="wsv" name="cbasic.name" value="${cbasic.name}"  /></td>
</tr>
<tr>
<th><span class="need"> </span>注册地址</th>
<td colspan="3"><input type="text" class="wsv" name="cbasic.regaddress" value="${cbasic.regaddress}" /></td>

</tr>
<tr>
<th><span class="need"> </span>公司类型</th>
<td><select name="cbasic.unitstype"  id="dd1a"></select></td>
<th><span class="need"></span>组织机构代码年检日期</th>
<td><input type="text" class="wsed"  name="cbasic.organizationcodeasy"  value="${cbasic.organizationcodeasy}" /> 年 <input type="text"  class="wsed"  name="cbasic.organizationcodeasm" value="${cbasic.organizationcodeasm}" /> 月 <input type="text" class="wsed"  name="cbasic.organizationcodeasd" value="${cbasic.organizationcodeasd}" /> 日 </td>
</tr>
<tr>
<th><span class="need"></span>贷款卡编码</th>
<td><input type="text" name="cbasic.creditcode" value="${cbasic.creditcode}" /></td>
<th><span class="need"></span>贷款卡密码</th>
<td><input type="text" name="cbasic.creditpassword" value="${cbasic.creditpassword}" /></td>
</tr>
<tr>
<th><span class="need"></span>贷款卡有效日期</th>

<td><input type="text"class="datepicker"  readonly="readonly" name="cbasic.creditvaliditydate" value="<s:date name="cbasic.creditvaliditydate" format="yyyy-MM-dd" />"  /></td>
<th><span class="need"></span>贷款卡状态</th>
<td><s:select list="#{1:'有效',2:'注销、吊销',3:'错误',4:'新增',5:'暂停'}"  name="cbasic.creditstates" value="cbasic.creditstates" ></s:select></td>
</tr>
<tr>
<th><span class="need"> </span>注册或批准成立日期</th>
<td><input type="text"class="datepicker"  readonly="readonly" name="cbasic.regdate" value="<s:date name="cbasic.regdate" format="yyyy-MM-dd" />" /></td>
<th><span class="need"> </span>注册或登记证件</th>
<td><select name="cbasic.regcertificates" id="dd2a"></select></td>

</tr>
<tr>
<th><span class="need"> </span>注册或登记证件号码</th>
<td><input type="text" name="cbasic.regcertificatesnumber" value="${cbasic.regcertificatesnumber}" /></td>
<th><span class="need"> </span>注册或顶级证件年检日期</th>
<td><input type="text" class="wsed"  name="cbasic.regcertificatesasdatey" value="${cbasic.regcertificatesasdatey }" />年<input type="text" class="wsed"  name="cbasic.regcertificatesasdatem" value="${cbasic.regcertificatesasdatem }" />月 <input type="text" class="wsed"  name="cbasic.regcertificatesasdated" value="${cbasic.regcertificatesasdated }" />日</td>

</tr>
<tr>
<th><span class="need"></span>营业或有效期</th>
<td colspan="3"><input type="text"class="datepicker"  readonly="readonly" name="cbasic.businessstarttime" value="<s:date name="cbasic.businessstarttime" format="yyyy-MM-dd" />" /> 至 <input type="text"class="datepicker"  readonly="readonly" name="cbasic.businessenddate" value="<s:date name="cbasic.businessenddate" format="yyyy-MM-dd" />" /> </td>


</tr>
<tr>
<th><span class="need"> </span>注册或开办币种</th>
<td> <select name="cbasic.regcurrency" id="dd3a"></select> </td>
<th><span class="need"> </span>注册金额</th>
<td><input type="text" name="cbasic.regfund" value="${cbasic.regfund}" class="numdiv"/>元</td>
</tr>
<tr>
<th><span class="need"></span>实收资本币种</th>
<td> <select name="cbasic.paidincapticalcurrency" id="dd3b"></select> </td>
<th><span class="need"></span>实收资本金额</th>
<td><input type="text" name="cbasic.paidincapticalfund" value="${cbasic.paidincapticalfund}" class="numdiv" />元</td>
</tr>
<tr>
<th><span class="need"></span>经营范围</th>
<td colspan="3"><input type="text" class="wet" name="cbasic.businessscope" value="${cbasic.businessscope }" /></td>

</tr>
<tr>
<th><span class="need"></span>国税登记证号码</th>
<td colspan="3"><input type="text" name="cbasic.nationaltaxnumbera" value="${cbasic.nationaltaxnumbera}" />税<input type="text" name="cbasic.nationaltaxnumberb" value="${cbasic.nationaltaxnumberb}" />字<input type="text" name="cbasic.nationaltaxnumberc" value="${cbasic.nationaltaxnumberc}" />号</td>
</tr>
<tr>
<th><span class="need"></span>地税登记证号码</th>
<td colspan="3"><input type="text" name="cbasic.originaltaxnumbera" value="${cbasic.originaltaxnumbera}" />税<input type="text" name="cbasic.originaltaxnumberb" value="${cbasic.originaltaxnumberb}" />字<input type="text" name="cbasic.originaltaxnumberc" value="${cbasic.originaltaxnumberc}" />号</td>
</tr>
<tr>
<th><span class="need"> </span>注册地城乡属性</th>
<td><s:select list="#{1:'城市地区',2:'农村地区'}" name="cbasic.urbanorrural" value="cbasic.urbanorrural" ></s:select></td>
<th><span class="need"> </span>经济类型</th>
<td><select name="cbasic.economictype"  id="dd4a"></select></td>
</tr>
<tr>
<th><span class="need"> </span>国标行业分类</th>

<td >
<select name="cbasic.ddica" value="cbasic.ddica" id="dda_id" onchange="">
</select>
</td>
<td colspan="2">
<select  name="cbasic.classificationofindustry" value="cbasic.classificationofindustry" id="ddb_id">
<option value="0">------------请选择------------</option>
</select>
</td>
</tr>
<tr>
<th><span class="need"> </span>企业规模</th>
<td colspan="3"><select name="cbasic.scale" id="dd5a"></select> </td>
</tr>
<!-- 
<tr>
<th><span class="need"></span>操作id</th>
<td><input type="text" name="cbasic.operatorid" value="${cbasic.operatorid}" /></td>
<th><span class="need"></span>操作日期</th>
<td><input type="text"class="datepicker"  readonly="readonly" name="cbasic.operatordate" value="${cbasic.operatordate}" /></td>
<th><span class="need"></span>创建日期</th>
<td><input type="text"class="datepicker"  readonly="readonly" name="cbasic.operatorcreatedate" value="${cbasic.operatorcreatedate}" /></td>
</tr>
 -->

</table>
<div id="button_area"><input type="submit" value="保存"/></div>

	
</form>
<script type="text/javascript">
<!--
	$(document).ready(function(){
		if($("#eflage").val() === 'show'){
			$("input[type='text']").prop("readonly", true);
			$("input[type='select']").prop("disabled", true);
			$("input[type='text']").addClass("companyid");
			//$("input[type='select']").addClass("companyid");
			$("#button_area").hide();
		}
	});
//-->
</script>
   <script type="text/javascript">  
    $(function(){
   		first();
   		$("#dda_id").click(function(){
   			getCom();
   		});
    });
    function first(){
      $.ajax({  
            cache:false,  
            url:'dropdown!findIcAList',  
            type:'post',  
            dataType:'json',  
            success:update_a,
          	  error: function(XMLHttpRequest, textStatus, errorThrown) {
	                 //alert(textStatus);
	             }
        });  
   }  
	
	
	 function update_a(data){  
    	//alert("inhere");
       // var comList=json.infor;
        //alert(data); 
        var s_root=document.getElementById('dda_id');  
        s_root.options.length=0; 
       
            var option = document.createElement("option");  
            var value=0;     
            var text='--------------------请选择--------------------';
            option.text=text;  
            option.value=value;  
            s_root.options[s_root.options.length] =option;
       
        for(var i in data){  
            var option = document.createElement("option");  
            var value=data[i].id;     
            var text=data[i].name;
            option.text=text;  
            option.value=value;  
            s_root.options[s_root.options.length] =option;
        }
        $("#dda_id").val(${cbasic.ddica});
        getCom();
          
    }  
	    
    
    function getCom(){  
        var pid=$("#dda_id").val();
        //alert(pid);
      
        $.ajax({  
            cache:false,  
            url:'dropdown!findIcBList',  
            type:'post',  
            dataType:'json',  
            data:{dda_id:pid}, 
            success:update_c,
          	  error: function(XMLHttpRequest, textStatus, errorThrown) {
	                 //alert(textStatus);
	             }
        });  
    }  
    function update_c(data){  
    	//alert("inhere");
       // var comList=json.infor;
        //alert(data); 
        var s_root=document.getElementById('ddb_id');  
        s_root.options.length=0; 
        var ppid=$("#dda_id").val();
       var option = document.createElement("option");  
            var value=0;     
            var text='------------请选择------------';
            option.text=text;  
            option.value=value;  
            s_root.options[s_root.options.length] =option;
        for(var i in data){  
            var option = document.createElement("option");  
            var value=data[i].id;     
            var text=data[i].name;
            var dda_id=data[i].pid;
            if(ppid==dda_id){
                option.text=text;  
                option.value=value;  
                s_root.options[s_root.options.length] =option;
            } 
        }
        $("#ddb_id").val(${cbasic.classificationofindustry}); 
    }  
</script>



 <script type="text/javascript">  
    $(function(){
    	setTimeout(function () { $.jstree._reference("#custom_company").open_node("#custom_company"); 1});
    	
    	newSelect("dd1a","findComList?ty=1",${cbasic.unitstype}0);
    	newSelect("dd2a","findComList?ty=2",${cbasic.regcertificates }0);
    	
    	newSelect("dd3a","findComList?ty=3",${cbasic.regcurrency }0);
    	newSelect("dd3b","findComList?ty=3",${cbasic.paidincapticalfund }0);
    	newSelect("dd4a","findComList?ty=4",${cbasic.economictype }0);
    	
    	newSelect("dd5a","findComList?ty=5",${cbasic.scale }0);
    });
    
    function newSelect(thisid,thisfun,def){
    	var parentid="#"+thisid;
    	var purl = "dropdown!"+ thisfun;
    	appendOption(purl,"",parentid,def);
	}
    function appendOption(thisurl,thisdata,thisid,defaultvalue){
        $.ajax({  
            cache:false,  
            url:thisurl,  
            type:'post',  
            dataType:'json',
            data:thisdata,
          	error: function(XMLHttpRequest, textStatus, errorThrown) {
				////alert(textStatus);
	        },
			success: function(data){
				$(thisid).empty();
				var i;
				var dataLists = eval(data);
				var dataLength=dataLists.length;
				//$(thisid).append("<option value='0'>--------------请选择-----------------</option>");
				for (i = 0; i < dataLength; i++) {
					$(thisid).append("<option value='"+dataLists[i].id+"'>"+dataLists[i].name+"</option>");  
				}
				
				$(thisid).val(defaultvalue/10);
			}
    	});
    }
</script>



